package com.heima.search.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.search.dto.HistorySearchDto;
import com.heima.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/history")
public class ApUserSearchController {
    @Autowired
    private SearchService searchService;


    //查询历史记录列表
    @PostMapping("load")
    public ResponseResult querySearchUser() {
        return searchService.querySearchData();
    }

    //删除历史记录
    @PostMapping("del")
    public ResponseResult deleteSearch(@RequestBody HistorySearchDto historySearchDto) {
        return searchService.deleteSearch(historySearchDto);
    }
}
